package com.bone.title.dao;

import java.util.List;
import java.util.Map;

import com.bone.common.BaseIbatisDAO;
import com.bone.title.po.Title;
import com.bone.title.po.TitleSetting;

public class TitleSettingDAO extends BaseIbatisDAO {
	 
	
	/**
	 * 保存标题设置信息.
	 * @param parameter
	 * @return
	 */
	public boolean insertTitleSetting(TitleSetting titleSetting){
		getSqlMapClientTemplate().insert("TITLE_SETTING.insert", titleSetting);
		return true;
	}
	
	/**
	 * 更新标题设置信息.
	 * @param parameter
	 * @return
	 */
	public boolean updateTitleSetting(TitleSetting titleSetting){
		getSqlMapClientTemplate().insert("TITLE_SETTING.update", titleSetting);
		return true;
	}
	
	/**
	 * 取符合查询条件的数据.
	 * @param para
	 * @return
	 */
	public Long queryTitleSettingCountByParam(Map<String, Object> para){
		return (Long) getSqlMapClientTemplate().queryForObject("TITLE_SETTING.queryCountTitleSettingByParam", para);
	}
	/**
	 * 取符合查询条件的数据.
	 * @param para
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public List<TitleSetting> queryTitleSettingPageByParam(Map<String, Object> para){
		return getSqlMapClientTemplate().queryForList("TITLE_SETTING.queryTitleSettingPageByParam", para);
	}
	
	/**
	 * 根据titleId取菜单的设置.
	 * @param titleId
	 * @return
	 */
	public TitleSetting  queryTitleSettingByTitleId(Long titleId){
		return (TitleSetting) getSqlMapClientTemplate().queryForObject("TITLE_SETTING.queryTitleSettingByTitleId", titleId);
	}
	
	/**
	 * 取符合查询条件的数据.
	 * @param para
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public List<TitleSetting> queryTitleSettingListByParam(Map<String, Object> para){
		return getSqlMapClientTemplate().queryForList("TITLE_SETTING.queryTitleSettingListByParam", para);
	}

	/**
	 * 根据标题的ID取相应的标题信息.
	 * @param titleId
	 * @return
	 */
	public TitleSetting queryTitleSettingBySetId(Long setId){
		return (TitleSetting) getSqlMapClientTemplate().queryForObject("TITLE_SETTING.queryTitleSettingBySetId", setId);
	}
	
}
